home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -serious- / programming / other / dopus412-gpl / program / dopusfunctions.h < prev    next >
C/C++ Source or Header  |  2000-02-28  |  10KB  |  397 lines

  1. /*
  2.  
  3. Directory Opus 4
  4. Original GPL release version 4.12
  5. Copyright 1993-2000 Jonathan Potter
  6.  
  7. This program is free software; you can redistribute it and/or
  8. modify it under the terms of the GNU General Public License
  9. as published by the Free Software Foundation; either version 2
  10. of the License, or (at your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. GNU General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  20.  
  21. All users of Directory Opus 4 (including versions distributed
  22. under the GPL) are entitled to upgrade to the latest version of
  23. Directory Opus version 5 at a reduced price. Please see
  24. http://www.gpsoft.com.au for more information.
  25.  
  26. The release of Directory Opus 4 under the GPL in NO WAY affects
  27. the existing commercial status of Directory Opus 5.
  28.  
  29. */
  30.  
  31. /* Defines relating to functions */
  32.  
  33. #ifndef DOPUS_FUNCTIONS
  34. #define DOPUS_FUNCTIONS
  35.  
  36. /* Internal Function Flags */
  37.  
  38. #define FUNCFLAGS_DIRS 1
  39. #define FUNCFLAGS_DEVS 2
  40. #define FUNCFLAGS_FILES 4
  41. #define FUNCFLAGS_ANYTHING 8
  42.  
  43. #define FUNCFLAGS_COPYISCLONE      256
  44. #define FUNCFLAGS_BYTEISCHECKFIT   256
  45.  
  46. /* External Function Flags */
  47.  
  48. #define FLAG_OUTWIND      1
  49. #define FLAG_OUTFILE      2
  50. #define FLAG_WB2F         4
  51. #define FLAG_DOPUSF       8
  52. #define FLAG_ASYNC       16
  53. #define FLAG_CDSOURCE    32
  54. #define FLAG_CDDEST      64
  55. #define FLAG_DOALL      128
  56. #define FLAG_RECURSE    256
  57. #define FLAG_RELOAD     512
  58. #define FLAG_ICONIFY   1024
  59. #define FLAG_NOQUOTE   2048
  60. #define FLAG_SCANSRCE  4096
  61. #define FLAG_SCANDEST  8192
  62. #define FLAG_SHELLUP  16384
  63. #define FLAG_DOPUSUP  32768
  64.  
  65. /* Recursive Operation Flags */
  66.  
  67. #define R_DELETE     1
  68. #define R_COPY       2
  69. #define R_HUNT       4
  70. #define R_COMMENT    8
  71. #define R_PROTECT    16
  72. #define R_DATESTAMP  32
  73. #define R_SEARCH     64
  74. #define R_GETNAMES   128
  75. #define R_GETBYTES   256
  76. #define R_STARDIR    512
  77.  
  78. /* Command List Flags */
  79.  
  80. #define RCL_NOBUTTON 1
  81. #define RCL_NEEDDEST 2
  82. #define RCL_NOFILE   4
  83. #define RCL_SYNONYM  8
  84.  
  85. /* FileType Commands */
  86.  
  87. #define FTYC_MATCH        1
  88. #define FTYC_MATCHNAME    2
  89. #define FTYC_MATCHBITS    3
  90. #define FTYC_MATCHCOMMENT 4
  91. #define FTYC_MATCHSIZE    5
  92. #define FTYC_MATCHDATE    6
  93. #define FTYC_MOVETO       7
  94. #define FTYC_MOVE         8
  95. #define FTYC_SEARCHFOR    9
  96. #define FTYC_OR         253
  97. #define FTYC_AND        254
  98. #define FTYC_ENDSECTION 255
  99.  
  100. #define FTYC_ENDLIMIT   252
  101. #define FTYC_COMMANDOK  10
  102.  
  103. /* FileType Functions */
  104.  
  105. #define FTFUNC_AUTOFUNC1   0
  106. #define FTFUNC_AUTOFUNC2   1
  107. #define FTFUNC_DOUBLECLICK 2
  108. #define FTFUNC_CLICKMCLICK 3
  109. #define FTFUNC_ANSIREAD    4
  110. #define FTFUNC_AUTOFUNC3   5
  111. #define FTFUNC_HEXREAD     6
  112. #define FTFUNC_LOOPPLAY    7
  113. #define FTFUNC_PLAY        8
  114. #define FTFUNC_AUTOFUNC4   9
  115. #define FTFUNC_READ        10
  116. #define FTFUNC_SHOW        11
  117.  
  118. /* Curly-Bracket Sequences */
  119.  
  120. #define FUNC_QUERYINFO   235
  121. #define FUNC_VARIABLE    236
  122. #define FUNC_SCREENNAME  237
  123. #define FUNC_REQUESTER   238
  124. #define FUNC_STDARG      239
  125. #define FUNC_NOSOURCE_RR 240
  126. #define FUNC_NODEST_RR   241
  127. #define FUNC_ENDARG      242
  128. #define FUNC_DEST_RR     243
  129. #define FUNC_SOURCE_RR   244
  130. #define FUNC_ONEFILE_NO  245
  131. #define FUNC_ALLFILES_NO 246
  132. #define FUNC_ONEPATH_NO  247
  133. #define FUNC_ALLPATHS_NO 248
  134. #define FUNC_ONEFILE     249
  135. #define FUNC_ALLFILES    250
  136. #define FUNC_SOURCE      251
  137. #define FUNC_DEST        252
  138. #define FUNC_GETARG      253
  139. #define FUNC_ONEPATH     254
  140. #define FUNC_ALLPATHS    255
  141.  
  142. /* Custom Function Types */
  143.  
  144. #define FT_INTERNAL     0
  145. #define FT_EXECUTABLE   1
  146. #define FT_WORKBENCH    2
  147. #define FT_BATCH        3
  148. #define FT_AREXX        4
  149. #define FT_REQUESTER    5
  150. #define FT_CHDIR       99
  151.  
  152. #define FC_INTERNAL     '*'
  153. #define FC_WORKBENCH    '%'
  154. #define FC_BATCH        '$'
  155. #define FC_AREXX        '&'
  156. #define FC_REQUESTER    '@'
  157. #define FC_CHDIR        '!'
  158.  
  159. /* List of Internal commands */
  160.  
  161. enum functionnums {
  162.     FUNC_TESTCMD,
  163.  
  164.     FUNC_ALL,
  165.     FUNC_NONE,
  166.     FUNC_PARENT,
  167.     FUNC_ROOT,
  168.     FUNC_BYTE,
  169.     FUNC_MAKEDIR,
  170.     FUNC_DELETE,
  171.     FUNC_CLONE,
  172.     FUNC_COPY,
  173.     FUNC_RENAME,
  174.     FUNC_MOVE,
  175.     FUNC_RUN,
  176.     FUNC_ENCRYPT,
  177.     FUNC_PLAY,
  178.     FUNC_SHOW,
  179.     FUNC_READ,
  180.     FUNC_HEXREAD,
  181.     FUNC_removed0,
  182.     FUNC_ADDICON,
  183.     FUNC_ASSIGN,
  184.     FUNC_COMMENT,
  185.     FUNC_DATESTAMP,
  186.     FUNC_PRINT,
  187.     FUNC_PROTECT,
  188.     FUNC_HUNT,
  189.     FUNC_SEARCH,
  190.     FUNC_AREXX,
  191.     FUNC_QUIT,
  192.     FUNC_ICONIFY,
  193.     FUNC_setdateremoved,
  194.     FUNC_ERRORHELP,
  195.     FUNC_HELP,
  196.     FUNC_SETCURDIR,
  197.     FUNC_CONFIGURE,
  198.     FUNC_FORMAT,
  199.     FUNC_DISKCOPY,
  200.     FUNC_INSTALL,
  201.     FUNC_SAVECONFIG,
  202.     FUNC_LASTSAVEDCONFIG,
  203.     FUNC_DEFAULTCONFIG,
  204.     FUNC_RELABEL,
  205.     FUNC_PRINTDIR,
  206.     FUNC_SELECT,
  207.     FUNC_ABOUT,
  208.     FUNC_OBSOLETE1,
  209.     FUNC_UNBYTE,
  210.     FUNC_COPYAS,
  211.     FUNC_LOOPPLAY,
  212.     FUNC_printremoved1,
  213.     FUNC_printremoved2,
  214.     FUNC_CLEARBUFFERS,
  215.     FUNC_NEWCLI,
  216.     FUNC_PARENT1,
  217.     FUNC_PARENT2,
  218.     FUNC_TOGGLE,
  219.     FUNC_AUTO,
  220.     FUNC_AUTO2,
  221.     FUNC_BUFFERLIST,
  222.     FUNC_RESELECT,
  223.     FUNC_DISKINFO,
  224.     FUNC_MOVEAS,
  225.     FUNC_SMARTREAD,
  226.     FUNC_REDRAW,
  227.     FUNC_removed1,
  228.     FUNC_RESCAN,
  229.     FUNC_PLAYST,
  230.     FUNC_STOPST,
  231.     FUNC_CONTST,
  232.     FUNC_LOADCONFIG,
  233.     FUNC_ANSIREAD,
  234.     FUNC_ICONINFO,
  235.     FUNC_SCANDIR,
  236.     FUNC_removedCUSTREQ,
  237.     FUNC_CLEARWINDOW,
  238.     FUNC_printremoved3,
  239.     FUNC_MODIFY,
  240.     FUNC_ENDFUNCTION,
  241.     FUNC_REMEMBER,
  242.     FUNC_RESTORE,
  243.     FUNC_ALARM,
  244.     FUNC_BEEP,
  245.     FUNC_ICONIFYBUTTONS,
  246.     FUNC_VERIFY,
  247.     FUNC_LOADSTRINGFILE,
  248.     FUNC_UNICONIFY,
  249.     FUNC_GETSTRING,
  250.     FUNC_DOPUSTOFRONT,
  251.     FUNC_DOPUSTOBACK,
  252.     FUNC_REQUEST,
  253.     FUNC_OTHERWINDOW,
  254.     FUNC_STATUS,
  255.     FUNC_FILEINFO,
  256.     FUNC_GETALL,
  257.     FUNC_GETFILES,
  258.     FUNC_GETDIRS,
  259.     FUNC_GETSELECTEDALL,
  260.     FUNC_GETSELECTEDFILES,
  261.     FUNC_GETSELECTEDDIRS,
  262.     FUNC_DEVICELIST,
  263.     FUNC_GETNEXTSELECTED,
  264.     FUNC_GETENTRY,
  265.     FUNC_SCROLLV,
  266.     FUNC_SCROLLH,
  267.     FUNC_NEXTDRIVES,
  268.     FUNC_PATTERNMATCH,
  269.     FUNC_BUSY,
  270.     FUNC_SELECTFILE,
  271.     FUNC_ADDFILE,
  272.     FUNC_REMOVEFILE,
  273.     FUNC_SWAPWINDOW,
  274.     FUNC_COPYWINDOW,
  275.     FUNC_TOPTEXT,
  276.     FUNC_DISPLAYDIR,
  277.     FUNC_DIRTREE,
  278.     FUNC_printremoved4,
  279.     FUNC_printremoved5,
  280.     FUNC_CHECKABORT,
  281.     FUNC_ADDCUSTENTRY,
  282.     FUNC_SETWINTITLE,
  283.     FUNC_ADDCUSTHANDLER,
  284.     FUNC_SELECTENTRY,
  285.     FUNC_REMOVEENTRY,
  286.     FUNC_VERSION,
  287.     FUNC_CHECKFIT,
  288.     FUNC_GETFILETYPE,
  289.     FUNC_SCROLLTOSHOW,
  290.     FUNC_AUTO3,
  291.     FUNC_AUTO4,
  292.     FUNC_BGFORMAT,
  293.     FUNC_BGDISKCOPY,
  294.     FUNC_BGINSTALL,
  295.     FUNC_QUERY,
  296.     FUNC_supportremoved,
  297.     FUNC_SETVAR,
  298.     FUNC_NOTIFY,
  299.     FUNC_PARENTLIST
  300. };
  301.  
  302.  
  303. struct CommandList {
  304.     char *name;
  305.     ULONG function;
  306.     ULONG flags;
  307. };
  308.  
  309. /* List of Internal commands */
  310.  
  311. extern struct CommandList commandlist[];
  312.  
  313. /* ARexx and Function data */
  314.  
  315. extern ULONG rexx_signalbit;                     /* Signal bit for ARexx port */
  316. extern SHORT rexx_argcount;                      /* ARexx argument count */
  317. extern char  *rexx_args[16];                     /* ARexx arguments */
  318. extern LONG  rexx_arg_value[16];                 /* Argument values */
  319. extern UBYTE rexx_global_flag;                   /* Signifies an ARexx command */
  320. extern char  *rexx_pathbuffer[2];                /* Path buffer of an ARexx argument */
  321. extern LONG  rexx_result_code;                   /* Return code for ARexx functions */
  322. extern LONG  rexx_return_value;                  /* RC for ARexx functions */
  323.  
  324. extern ULONG func_global_function;               /* Global function number */
  325. extern char  func_single_file[32];               /* Single file to operate on */
  326. extern char  func_external_file[256];            /* External file to operate on */
  327. extern struct Directory *func_single_entry;      /* Single entry to operate on */
  328. extern UBYTE func_entry_deleted;                 /* Indicates entry was deleted */
  329.  
  330. extern struct DirWindowPars func_reselection;    /* Reselection data */
  331.  
  332. /* Parameters recognised by the Modify command */
  333.  
  334. extern char *modifynames[];
  335.  
  336. /* Data for Remember/Restore function */
  337.  
  338. extern struct RememberData *remember_data;       /* Storage for remembered data */
  339.  
  340. /* Date for Search function */
  341.  
  342. extern int search_flags;                         /* Search flags */
  343. extern char *search_found_position;              /* Position of match */
  344. extern int search_found_size;                    /* Bytes searched */
  345. extern int search_found_lines;                   /* Lines searched */
  346. extern int search_last_line_pos;                 /* Last line position searched */
  347.  
  348. /* Data for Show Info routine */
  349.  
  350. extern struct TextFont *show_global_font;        /* Font info */
  351. extern struct DiskObject *show_global_icon;      /* Icon info */
  352. extern char *show_global_icon_name;              /* Icon name */
  353.  
  354. /* Directory tree graphics items */
  355.  
  356. #define DIRTREEGFX_VERT        0                 /* |  */
  357. #define DIRTREEGFX_VERTCROSS   1                 /* |- */
  358. #define DIRTREEGFX_CROSS       2                 /* -  */
  359. #define DIRTREEGFX_BRANCH      3                 /* +  */
  360. #define DIRTREEGFX_FINALCROSS  4                 /*  - */
  361.  
  362. /* ARexx Status values */
  363.  
  364. #define RXSTATUS_CURRENT_DIRECTORY          1
  365. #define RXSTATUS_VERSION                    2
  366. #define RXSTATUS_ACTIVE_WINDOW              3
  367. #define RXSTATUS_NUMBER_OF_FILES            4
  368. #define RXSTATUS_NUMBER_OF_DIRS             5
  369. #define RXSTATUS_NUMBER_OF_ENTRIES          6
  370. #define RXSTATUS_NUMBER_SELECTED_FILES      7
  371. #define RXSTATUS_NUMBER_SELECTED_DIRS       8
  372. #define RXSTATUS_NUMBER_SELECTED_ENTRIES    9
  373. #define RXSTATUS_TOTAL_BYTES                10
  374. #define RXSTATUS_TOTAL_SELECTED_BYTES       11
  375. #define RXSTATUS_SELECT_PATTERN             12
  376. #define RXSTATUS_DIRECTORY_NAME             13
  377. #define RXSTATUS_DISK_NAME                  14
  378. #define RXSTATUS_DISK_FREE_BYTES            15
  379. #define RXSTATUS_DISK_TOTAL_BYTES           16
  380. #define RXSTATUS_BUFFERED_DIRECTORY_NAME    17
  381. #define RXSTATUS_BUFFERED_DISKNAME          18
  382. #define RXSTATUS_BUFFERED_DISK_FREE_BYTES   19
  383. #define RXSTATUS_BUFFERED_DISK_TOTAL_BYTES  20
  384. #define RXSTATUS_BUFFER_DISPLAYED           21
  385. #define RXSTATUS_DISPLAY_OFFSET             22
  386. #define RXSTATUS_ENTRIES_PER_PAGE           24
  387. #define RXSTATUS_CONFIGURATION_CHANGED      25
  388. #define RXSTATUS_OKAY_STRING                26
  389. #define RXSTATUS_CANCEL_STRING              27
  390. #define RXSTATUS_ICONIFIED                  28
  391. #define RXSTATUS_TOP_TEXT_JUSTIFY           30
  392. #define RXSTATUS_CONFIGURATION_ADDRESS      31
  393. #define RXSTATUS_FIRST_NODE                 33
  394. #define RXSTATUS_CURRENT_BANK_NUMBER        34
  395.  
  396. #endif
  397.